import { createRouter, createWebHistory } from 'vue-router'

import Article from '@/pages/Home/Article.vue'
import Overview from '@/pages/Home/Overview.vue'
import Publish from '@/pages/Home/Publish.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { 
      path: '/login',
      component: () => import('@/pages/Login.vue'),
    },
    {
      path: '/',
      component: () => import('@/pages/Home/index.vue'),
      redirect: '/overview',
      children: [
        {
          path: '/overview',
          component: Overview,
        },
        {
          path: '/article',
          component: Article,
        },
        {
          path: '/publish',
          component: Publish,
        },
      ]
    }
  ],
})

export default router
